package com.test.practice.oo.finalStatic;

/**
 * @Desc: 可以写多个statci方法，但是是要按照写的顺序执行
 * ----------------
 * @CLASS_NAME: StaticTest5
 * ----------------
 * @Author: jovi
 * ----------------
 * @Date: 2020-05-06 14:59
 */
public class StaticTest5 {

    private static int a;
    private int b;

    public void print() {
        System.out.println("hello");
    }

    static {
        StaticTest5.a = 5;
        System.out.println(a);
        //这里如果把这个实例化放在static块外面就会报错
        StaticTest5 staticTest5 = new StaticTest5();
        staticTest5.print();
        staticTest5.b = 10000;
        System.out.println(staticTest5.b);
    }

    static {
        StaticTest5.a = 6;
        System.out.println(a);
    }

    static {
        StaticTest5.a = 7;
        System.out.println(a);
    }

    public static void main(String[] args) {

    }
}
